Add referer header for Duck Player - #6407
Merged
Merged
Conversation
CrisBarreiro
force-pushed
the
feature/cris/duckplayer/add-referer-header
branch
from
July 16, 2025 15:29
14e08f2 to
c7ee8da
Compare
marcosholgado
left a comment
Contributor
There was a problem hiding this comment.
Tried to test this but was not able to. Couldn't consistently see embeds calls, with Charles they are all encrypted since we don't own the domain and with chrome inspect it only gave me the basic headers.
Would be great to have more detailed testing steps and also change from draft to ready to review once the TODO is done.
CrisBarreiro
force-pushed
the
feature/cris/duckplayer/add-referer-header
branch
2 times, most recently
from
July 30, 2025 15:15
47ca5de to
c2ffb28
Compare
CrisBarreiro
force-pushed
the
feature/cris/duckplayer/add-referer-header
branch
from
July 30, 2025 15:19
c2ffb28 to
6222e57
Compare
CrisBarreiro
marked this pull request as ready for review
July 31, 2025 08:44
| return processSimulatedYouTubeNoCookieUri(url, webView) | ||
| } else if (duckPlayerFeature.addCustomEmbedReferer().isEnabled() && isYouTubeNoCookieEmbedUri(url, webViewUrl)) { | ||
| return try { | ||
| WebResourceResponse("text/html", "UTF-8", getEmbedWithReferer(request)) |
Contributor
There was a problem hiding this comment.
getEmbedWithReferer() can return null, would that be the correct thing to send in the WebResourceResponse?
Collaborator
Author
There was a problem hiding this comment.
Good call. When I made it nullable, I was thinking to return a null response (so we continue loading the original request), but that's not what I'm doing here. Thanks for catching it!
joshliebe
pushed a commit
that referenced
this pull request
Aug 8, 2025
Task/Issue URL: https://app.asana.com/1/137249556945/task/1210811808963690?focus=true ### Description Set referer header to local assets directory in compliance with new TOS ### Steps to test this PR _Feature 1_ - [ ] Set up Charles Proxy - [ ] Disable macOS proxy under Charles toolbar > Proxy - [ ] Enable SSL proxying and include location `*:*` under Charles toolbar > Proxy > SSL Proxying settings - [ ] Check IP address under Charles toolbar > Help > Local IP addresses. Check port under Charles toolbar > Proxy settings - [ ] Set up proxy for WiFi connection on your phone by setting IP address and port from previous step - [ ] Open the app and load http://charlesproxy.com/getssl - [ ] Download the certificate and install as CA certificate - [ ] Load a video on Duck Player - [ ] Using Charles proxy, check that requests to `https://www.youtube-nocookie.com/embed/...` have `referer` header set to `http://android.mobile.duckduckgo.com` ### UI changes n/a
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Task/Issue URL: https://app.asana.com/1/137249556945/task/1210811808963690?focus=true
Description
Set referer header to local assets directory in compliance with new TOS
Steps to test this PR
Feature 1
*:*under Charles toolbar > Proxy > SSL Proxying settingshttps://www.youtube-nocookie.com/embed/...haverefererheader set tohttp://android.mobile.duckduckgo.comUI changes
n/a